
<?php

require DT_CORE.'/buyhelp/common.inc.php';
defined('IN_IXDCW') or exit('Access Denied');
$navname ='drive';
$MOD['name']='买车助手_试驾';

$table      = Table::name(Table::NAME_CATEGORY);
$tableG     = Table::name(Table::NAME_GUIDE);


/*筛选项*/
$typeArr    = $db->getAll("select catid,catname from $table where parentid=3592 order by listorder");
foreach($typeArr as $val) {
	$TYPES[$val['catid']] = $val['catname'];
}


/*车型类别 车系id*/
$autoId = AutoCategoryModule::getCarbylevel($cartypeid);

/*试驾类别：试驾体验 进口车 国产车*/
$catIds = $db->getVar("select arrchildid from $table where catid=3592");

/*幻灯片*/
$sql = "select itemid,title,thumb,linkurl,edittime from $tableG where catid in($catIds) and arcid in($autoId) and status=3 and level=2 and thumb!='' order by edittime desc limit 8";
$PicDrive = $db->getAll($sql);

/*热门试驾*/
$sql = "select itemid,title,thumb,linkurl,edittime from $tableG where catid in($catIds) and arcid in($autoId) and status=3 and level=1 order by edittime desc limit 8";
$HotDrive = $db->getAll($sql);


/*图文推荐*/
$sql = "select itemid,title,thumb,linkurl,edittime from $tableG where catid in($catIds) and arcid in($autoId) and status=3 and level=3 order by edittime desc limit 3";
$PicRecommend = $db->getAll($sql);

/*最新试驾*/
$sql = "select itemid,title,thumb,linkurl,edittime from $tableG where catid in($catIds) and arcid in($autoId) and status=3 order by edittime desc limit 20";
$latestDrive = $db->getAll($sql);

/*试驾 视频*/
$videoCatid = 3275;
$autoVideo = $db->getAll("select * from xd_video where catid=$videoCatid order by addtime DESC limit 4");




include template('drive','buyhelp');
